package com.inmaytide.website.facade.deploy.impl;

import com.inmaytide.website.domain.entities.deploy.DeployProject;
import com.inmaytide.website.facade.deploy.DeployProjectFacade;
import com.inmaytide.website.framework.bean.JsonResult;
import com.inmaytide.website.service.deploy.DeployProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeployProjectFacadeImpl implements DeployProjectFacade {

    @Autowired
    private DeployProjectService deployProjectService;

    @Override
    public List<DeployProject> findList() {
        return deployProjectService.findList();
    }

    @Override
    public DeployProject findOne(Long id) {
        return deployProjectService.findOne(id);
    }

    @Override
    public JsonResult save(DeployProject project) {
        return deployProjectService.save(project);
    }

    @Override
    public long getMaxSort() {
        return deployProjectService.getMaxSort();
    }

    /**
     * 验证服务器文件夹
     *
     * @param path
     * @return
     */
    @Override
    public boolean validDir(String path) {
        return deployProjectService.validDir(path);
    }

    @Override
    public JsonResult delete(Long id) {
        return deployProjectService.delete(id);
    }

    @Override
    public List<DeployProject> findProjectsInUse() {
        return deployProjectService.findProjectsInUse();
    }

}
